#import "CustomTabBarViewController.h"
#import "CustomTabBar.h"
#import "CustomTabBarItem.h"
#import "FRQHomeViewController.h"
#import "FRQSettingsViewController.h"
#import "BaseNavoigationViewController.h"
@interface CustomTabBarViewController ()
 
@end
 
@implementation CustomTabBarViewController
 
- (void)viewDidLoad {
    [super viewDidLoad];
    [self initViewController];
    self.navigationController.navigationBarHidden = YES;
    
    UITabBarAppearance *appearance = [UITabBarAppearance new];
    // 去掉半透明效果
    appearance.backgroundEffect = nil;
    self.tabBar.standardAppearance = appearance;
    self.tabBar.backgroundColor=skUIColorFromRGB(0x4e555f);
    
}
 
-(void)initViewController{
   // [self.tabBar.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
    
    FRQHomeViewController *homePageVC = [[FRQHomeViewController alloc] init];
    BaseNavoigationViewController *view1=[[BaseNavoigationViewController alloc] initWithRootViewController:homePageVC];
    
    FRQSettingsViewController *centerPageVC = [[FRQSettingsViewController alloc] init];
    BaseNavoigationViewController *view2=[[BaseNavoigationViewController alloc] initWithRootViewController:centerPageVC];
    
    self.viewControllers = @[view1,view2];
    
 
    CustomTabBar *customTabBarView = [[CustomTabBar alloc] initWithFrame:self.tabBar.bounds];
 
    customTabBarView.tabBarItemAttributes = @[
    @{CustomTabBarItemAttributeTitle : @"Galleries", CustomTabBarItemAttributeNormalImageName : @"ico_bottom_nav_galleries_nor", CustomTabBarItemAttributeSelectedImageName : @"ico_bottom_nav_galleries_sel", CustomTabBarItemAttributeType : @(CustomTabBarItemNormal)},
    @{CustomTabBarItemAttributeTitle : @"Settings", CustomTabBarItemAttributeNormalImageName : @"ico_bottom_nav_settings_nor", CustomTabBarItemAttributeSelectedImageName : @"ico_bottom_nav_settings_sel", CustomTabBarItemAttributeType : @(CustomTabBarItemNormal)}];
    
    [self.tabBar addSubview:customTabBarView];
}
 
@end
